// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

#nullable restore

using System;
using System.Linq;
using Elastic.Clients.Elasticsearch.Serialization;

namespace Elastic.Clients.Elasticsearch.QueryDsl;

[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.TermsQueryFieldConverter))]
public sealed partial class TermsQueryField : Elastic.Clients.Elasticsearch.Union<System.Collections.Generic.ICollection<Elastic.Clients.Elasticsearch.FieldValue>, Elastic.Clients.Elasticsearch.QueryDsl.TermsLookup>
{
	public TermsQueryField(System.Collections.Generic.ICollection<Elastic.Clients.Elasticsearch.FieldValue> value) : base(value)
	{
	}

	public TermsQueryField(Elastic.Clients.Elasticsearch.QueryDsl.TermsLookup value) : base(value)
	{
	}

	public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField(Elastic.Clients.Elasticsearch.FieldValue[] value) => new Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField(value);
	public static implicit operator Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField(Elastic.Clients.Elasticsearch.QueryDsl.TermsLookup value) => new Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField(value);
}

public readonly partial struct TermsQueryFieldFactory<TDocument>
{
	public Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField Value(System.Collections.Generic.ICollection<Elastic.Clients.Elasticsearch.FieldValue> value)
	{
		return new Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField(value);
	}

	public Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField Value(params Elastic.Clients.Elasticsearch.FieldValue[] values)
	{
		return new Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField([.. values]);
	}

	public Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField Lookup(Elastic.Clients.Elasticsearch.QueryDsl.TermsLookup value)
	{
		return new Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField(value);
	}

	public Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField Lookup(System.Action<Elastic.Clients.Elasticsearch.QueryDsl.TermsLookupDescriptor<TDocument>> action)
	{
		return new Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField(Elastic.Clients.Elasticsearch.QueryDsl.TermsLookupDescriptor<TDocument>.Build(action));
	}

	[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
	internal static Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField Build(System.Func<Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryFieldFactory<TDocument>, Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField> action)
	{
		var builder = new Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryFieldFactory<TDocument>();
		return action.Invoke(builder);
	}
}

public readonly partial struct TermsQueryFieldFactory
{
	public Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField Value(System.Collections.Generic.ICollection<Elastic.Clients.Elasticsearch.FieldValue> value)
	{
		return new Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField(value);
	}

	public Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField Value(params Elastic.Clients.Elasticsearch.FieldValue[] values)
	{
		return new Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField([.. values]);
	}

	public Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField Lookup(Elastic.Clients.Elasticsearch.QueryDsl.TermsLookup value)
	{
		return new Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField(value);
	}

	public Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField Lookup(System.Action<Elastic.Clients.Elasticsearch.QueryDsl.TermsLookupDescriptor> action)
	{
		return new Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField(Elastic.Clients.Elasticsearch.QueryDsl.TermsLookupDescriptor.Build(action));
	}

	public Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField Lookup<T>(System.Action<Elastic.Clients.Elasticsearch.QueryDsl.TermsLookupDescriptor<T>> action)
	{
		return new Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField(Elastic.Clients.Elasticsearch.QueryDsl.TermsLookupDescriptor<T>.Build(action));
	}

	[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
	internal static Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField Build(System.Func<Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryFieldFactory, Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField> action)
	{
		var builder = new Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryFieldFactory();
		return action.Invoke(builder);
	}
}